<script>
	export default {
		globalData: {
			audio: null,
			adcustom: 0,
		},
		onLaunch: function() {
			// if (uni.$u.platform == 'h5') {
			// 	let appPage = document.querySelector('uni-page-head');
			// 	if (appPage){
			// 		appPage.style.display="none"
			// 		// appPage.remove()
			// 	}
			// }
			this.utils.common();


			// #ifdef MP-WEIXIN
			//更新检测
			if (wx.canIUse('getUpdateManager')) {
				const updateManager = wx.getUpdateManager();
				console.log(updateManager)
				updateManager && updateManager.onCheckForUpdate((res) => {
					if (res.hasUpdate) {
						updateManager.onUpdateReady(() => {
							uni.showModal({
								title: '更新提示',
								content: '新版本已经准备就绪，是否需要重新启动应用？',
								success: (res) => {
									if (res.confirm) {
										uni.clearStorageSync() // 更新完成后刷新storage的数据
										updateManager.applyUpdate()
									}
								}
							})
						})

						updateManager.onUpdateFailed(() => {
							uni.showModal({
								title: '已有新版本上线',
								content: '小程序自动更新失败，请删除该小程序后重新搜索打开哟~~~',
								showCancel: false
							})
						})
					} else {
						//没有更新
					}
				})
			} else {
				uni.showModal({
					title: '提示',
					content: '当前微信版本过低，无法使用该功能，请更新到最新的微信后再重试。',
					showCancel: false
				})
			}
			// #endif
		},
		onShow: function() {

			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>

<style lang="scss">
	@import "@/uni_modules/uview-ui/index.scss";
	@import '/common/css/font.css';

	/* #ifdef H5 */
	uni-page-head {
		display: none;
	}

	/* #endif */
	page {
		width: 100%;
		height: 100vh;
		background-color: #f2f2f2;
	}

	.page {
		width: 100%;
		height: 100vh;
		background-color: #f2f2f2;
	}

	view {
		box-sizing: border-box;
	}

	/* 公共样式 */
	.show {
		display: block;
	}

	.hide {
		display: none;
	}

	.ad {
		width: 92%;
		margin: 0 auto;
		margin-top: 20px;
	}

	/* 覆盖uview样式 */
	.base-form .u-form-item--left__content__label {
		text-align: justify;
		text-align-last: justify;
		display: inline-block !important;
	}

	.u-transition {
		z-index: 88888888;
	}


	/*粉色*/
	.pink-color {
		color: #F6607B !important;
	}

	.pink-bg {
		background-color: #F6607B !important;
		color: #fff !important;
	}

	.pink-border {
		border: 1px solid #F6607B !important;
	}

	.pink-border-top {
		border-top: 1px solid #F6607B !important;
	}

	/*蓝色*/
	.blue-color {
		color: #0187FF !important;
	}

	.blue-bg {
		background-color: #0187FF !important;
		color: #fff !important;
	}

	.blue-border {
		border: 1px solid #0187FF !important;
	}

	.blue-border-top {
		border-top: 1px solid #0187FF !important;
	}

	/*橙色*/
	.orange-color {
		color: #f19149 !important;
	}

	.orange-bg {
		background-color: #f19149 !important;
		color: #fff !important;
	}

	.orange-border {
		border: 1px solid #f19149 !important;
	}

	.orange-border-top {
		border-top: 1px solid #f19149 !important;
	}

	/*绿色*/
	.green-color {
		color: #4caf50 !important;
	}

	.green-bg {
		background-color: #4caf50 !important;
		color: #fff !important;
	}

	.green-border {
		border: 1px solid #4caf50 !important;
	}

	.green-border-top {
		border-top: 1px solid #4caf50 !important;
	}

	/*黑色*/
	.black-color {
		color: #4caf50 !important;
	}

	.black-bg {
		background-color: #4caf50 !important;
		color: #fff !important;
	}

	.black-border {
		border: 1px solid #4caf50 !important;
	}

	.black-border-top {
		border-top: 1px solid #4caf50 !important;
	}
</style>
